import multiprocessing

from libs.pyqt5braisedpork.controller.generic import BaseController


class YeChatController(BaseController):
    """yeChat 窗口控制器类"""

    def set_max_thread(self):
        """设置最大可用线程"""
        cpu_count = multiprocessing.cpu_count()
        self.horizontalSlider_threadNum.setMaximum(cpu_count)

    def add_browser_text(self, text):
        """在 TextBrowser 中添加一行 text"""
        self.textBrowser_scanMsg.append(text)
